<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5">
{
  style: {
    navigationStyle: 'custom',
    navigationBarTitleText: '流水明细',
    navigationBarRightButton: {
      hide: true,
    },
  },
}
</route>
<template>
  <view
    class="w-full h-full bg-white overflow-hidden box-border"
    :style="{ paddingTop: safeAreaInsets?.top + 'px' }"
  >
    <view class="w-full h-full home-container">
      <wd-navbar @click-left="handleClickLeft">
        <template #title>
          <text class="text-gray-333 font-size-36 font-500">流水明细</text>
        </template>
        <template #left>
          <wd-icon
            name="chevron-left"
            class="text-gray-333 font-size-44"
            @click="pagesBack"
          ></wd-icon>
        </template>
      </wd-navbar>
      <view class="w-full h-full p-x-28 home-content">
        <view class="flex">
          <wd-tabs v-model="tab">
            <block v-for="item in tabHeader" :key="item">
              <wd-tab :title="item.title">
                <view class="w-full hr-640 overflow-auto tab-con-height">
                  <view class="w-full" v-for="(item, index) in tabContentList" :key="index">
                    <view class="flex justify-center flex-col hr-142">
                      <view
                        class="flex justify-between items-center font-400 font-size-32 line-height-none"
                      >
                        <view class="text-gray-333">{{ item.title }}</view>
                        <view class="text-blue-1" v-if="item.status === 0">+{{ item.value }}</view>
                        <view class="text-gray-333" v-if="item.status === 1">
                          -{{ item.value }}
                        </view>
                      </view>
                      <view class="text-gray-999 font-400 font-size-24 mg-t-20 line-height-none">
                        {{ item.time }}
                      </view>
                    </view>
                    <view class="w-full hr-2 bg-#f5f5f5"></view>
                  </view>
                </view>
              </wd-tab>
            </block>
          </wd-tabs>
        </view>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
defineOptions({
  name: 'ShareLedger',
})
const { safeAreaInsets } = uni.getSystemInfoSync()
const joy = 'https://img.yzcdn.cn/vant/cat.jpeg'
const handleClickLeft = () => {}
const pagesBack = () => {
  uni.navigateTo({
    url: '/pages/person/shareMoney',
  })
}
const tab = ref(0)
const tabHeader = ref([{ title: '全部' }, { title: '获取' }, { title: '消耗' }])
const tabContentList = ref([
  {
    title: '分享课程',
    time: '2023-02-01 12:00:00',
    value: 5,
    status: 0,
  },
  {
    title: '分享课程',
    time: '2023-02-01 12:00:00',
    value: 5,
    status: 0,
  },
  {
    title: '分享课程',
    time: '2023-02-01 12:00:00',
    value: 5,
    status: 1,
  },
  {
    title: '分享课程',
    time: '2023-02-01 12:00:00',
    value: 5,
    status: 0,
  },
  {
    title: '分享课程',
    time: '2023-02-01 12:00:00',
    value: 5,
    status: 1,
  },
])
onLoad(() => {})
</script>

<style scoped lang="scss">
.home-container {
  position: relative;
  z-index: 1;
}
.home-content {
  height: calc(100% - var(--wot-navbar-height, 88rpx));
  overflow: auto;
}
.tab-con-height {
  height: calc(100vh - 256rpx);
}
::v-deep .wd-button {
  width: 100% !important;
  height: 100% !important;
}
::v-deep .wd-tabs__nav-item {
  font-size: 32rpx !important;
  color: #312f2a !important;
}
</style>
